import request from '@/utils/request'


// 查询活动报名列表
export function listEnroll(query) {
  return request({
    url: '/ypp/enroll/list',
    method: 'get',
    params: query
  })
}

// 查询活动报名列表
export function listSnpEnroll(query) {
  return request({
    url: '/ypp/enroll/snp/list',
    method: 'get',
    params: query
  })
}

//修改订单价格、退差价
export function editPrice(id,price,type,reason){
  return request({
    url:'/ypp/enroll/editOrder?id='+id+'&&discount='+price+'&&type='+type+"&&reason="+reason,
    method:'get'
  })
}

//修改订单价格、退差价
export function editBy(id,reason){
  return request({
    url:'/ypp/enroll/editBy?id='+id+'&&reason='+reason,
    method:'get'
  })
}

//修改已报名订单档期
export function changeGeneration(id,generationId){
  return request({
    url:'/ypp/enroll/change/generation?id='+id+'&&generationId='+generationId,
    method:'get'
  })
}


// 查询活动报名详细
export function getEnroll(id) {
  return request({
    url: '/ypp/enroll/' + id,
    method: 'get'
  })
}

// 查询活动报名详细
export function getEnrollDetail(id) {
  return request({
    url: '/ypp/enroll/' + id,
    method: 'get'
  })
}

// 查询活动报名详细
export function getSnpEnrollDetail(id) {
  return request({
    url: '/ypp/enroll/snp/' + id,
    method: 'get'
  })
}


// 新增活动报名
export function addEnroll(data) {
  return request({
    url: '/ypp/enroll',
    method: 'post',
    data: data
  })
}

// 修改活动报名
export function updateEnroll(data) {
  return request({
    url: '/ypp/enroll',
    method: 'put',
    data: data
  })
}

// 删除活动报名
export function delEnroll(id) {
  return request({
    url: '/ypp/enroll/' + id,
    method: 'delete'
  })
}

// 删除活动报名
export function delSnpEnroll(id) {
  return request({
    url: '/ypp/enroll/snp/' + id,
    method: 'delete'
  })
}

// 导出活动报名
export function exportEnroll(query) {
  return request({
    url: '/ypp/enroll/export',
    method: 'get',
    params: query
  })
}

// 导出活动报名
export function exportSnpEnroll(query) {
  return request({
    url: '/ypp/enroll/snp/export',
    method: 'get',
    params: query
  })
}

// 导出活动报名
export function exportSelectedSnpEnroll(ids) {
  return request({
    url: '/ypp/enroll/snp/export/selected/' + ids,
    method: 'get'
  })
}


// 报名审核不通过
export function checkApply(query) {
  return request({
    url: '/ypp/enroll/checkapply?' + query,
    method: 'get',
    timeout: 30000
  })
}

// 报名审核不通过
export function snpCheckApply(query) {
  return request({
    url: '/ypp/enroll/snp/checkapply?' + query,
    method: 'get',
    timeout: 30000
  })
}

// 取消报名审核不通过
export function checkOut(data) {
  return request({
    url: '/ypp/enroll/checkout',
    method: 'put',
    data: data
  })
}

// 取消报名审核批量不通过
export function checkOutBatch1(id,outCause) {
  return request({
    url: '/ypp/enroll/checkoutBatch?ids='+id+"&&outCause="+outCause,
    method: 'get'
  })
}

// 少年派取消报名审核批量不通过
export function checkOutBatch2(id,outCause) {
  return request({
    url: '/ypp/enroll/snp/checkoutBatch?ids='+id+"&&outCause="+outCause,
    method: 'get'
  })
}


// 统计数量
export function countEnroll(query) {
  return request({
    url: '/ypp/enroll/enrollCount',
    method: 'get',
    params: query
  })
}

// 报名成功退回待审核状态
export function rollBackAudit(id) {
  return request({
    url: '/ypp/enroll/rollBackAudit/' + id,
    method: 'put'
  })
}

// 报名批量审核通过
export function checkApplyBatch(id) {
  return request({
    url: '/ypp/enroll/checkapplybatch/'+ id,
    method: 'put'
  })
}

// 退赛批量审核通过
export function checkOutBatch(id) {
  return request({
    url: '/ypp/enroll/checkoutbatch/'+ id,
    method: 'put'
  })
}

// 报名成功退回待审核状态
export function snpRollBackAudit(id) {
  return request({
    url: '/ypp/enroll/snp/rollBackAudit/' + id,
    method: 'put'
  })
}

// 报名批量审核通过
export function snpCheckApplyBatch(id) {
  return request({
    url: '/ypp/enroll/snp/checkapplybatch/'+ id,
    method: 'put'
  })
}

// 退赛批量审核通过
export function snpCheckOutBatch(id) {
  return request({
    url: '/ypp/enroll/snp/checkoutbatch/'+ id,
    method: 'put'
  })
}
